<?php

namespace App\Http\Controllers\home;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

use DB;

class doSuccessController extends Controller
{
    //
    public function index(Request $request)
    {
    	// dd($request->all());
    	$data = $request->all();
    	$money = $request->all()['money'];
    	$uname = $request->all()['uname'];

    	$row = DB::table('order')->insertGetId($data);
    	if($row > 0){
            return view('home.success', ['money' => $money, 'uname' => $uname]);
        }else{
            return view('home.success');
        }
    }
}
